﻿using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;

namespace Jian.Vubackup.MySql.Tool
{
    /// <summary>
    /// 平台帮助类
    /// </summary>
    public class PlatformHelper
    {
        /// <summary>
        /// 是否是Linux
        /// </summary>
        public static bool IsLinux
        {
            get
            {
                return RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
            }
        }

        /// <summary>
        /// 是否是Windows
        /// </summary>
        public static bool IsWindows
        {
            get
            {
                return RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
            }
        }

        /// <summary>
        /// 是否是MacOS
        /// </summary>
        public static bool IsMac
        {
            get
            {
                return RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
            }
        }
    }
}
